import request from '@/utils/request'

/*****************************角色设置******************************/
//获取角色列表
export function getActorList() {
  return request({
    url: '/actor/getActorList',
    method: 'get',
  })
}
//根据ID获取角色详细信息
export function getActorById(id) {
  return request({
    url: '/actor/getActorById/' + id,
    method:'get',
  })
}

//添加角色
export function addOrUpdateActor(id, name, isuse, sortnum, memo) {
  return request({
    url: '/actor/addOrUpdateActor',
    method:'post',
    data: {
      id,
      name,
      isuse,
      sortnum,
      memo
    }
  })
}
export function deleteActor(id) {
  return request({
    url: '/actor/deleteActor/' + id,
    method:'get',
  })
}


/*****************************菜单权限******************************/
//获取左侧已选按钮
export function getSelectedMenu(id) {
  return request({
    url: '/actor/getSelectedMenu/' + id,
    method: 'get',
  })
}

//获取未选菜单
export function getNotSelectedMenu(id) {
  return request({
    url: '/actor/getNotSelectedMenu/' + id,
    method: 'get',
  })
}

//添加菜单
export function addMenu(roleCode, menuCode) {
  return request({
    url: '/actor/addMenu/' + roleCode + "/" + menuCode,
    method: 'get',
  })
}

//删除已选菜单
export function deleteMenu(roleCode, menuCode) {
  return request({
    url: '/actor/deleteMenu/' + roleCode + "/" + menuCode,
    method: 'get',
  })
}
/*****************************科室权限******************************/
//查询已选科室
export function getSelectedDept(roleCode) {
  return request({
    url: '/actor/getSelectedDept/' + roleCode,
    method: 'get',
  })
}

//查询未选科室
export function getNotSelectedDept(roleCode) {
  return request({
    url: '/actor/getNotSelectedDept/' + roleCode,
    method: 'get',
  })
}

//添加科室
export function addActorDept(roleCode, deptCode) {
  return request({
    url: '/actor/addActorDept/' + roleCode + "/" +deptCode,
    method: 'get',
  })
}

//删除科室
export function deleteActorDept(roleCode, deptCode) {
  return request({
    url: '/actor/deleteActorDept/' + roleCode + "/" +deptCode,
    method: 'get',
  })
}
